<!--
 * @Author: Mcc
 * @Date: 2024-07-29 17:18:12
 * @LastEditors: 王明明834578987 10266004+wang-mingming-834578987@user.noreply.gitee.com
 * @LastEditTime: 2024-09-18 10:21:10
 * @FilePath: \ft-apply-admin\src\App.vue
 * @Description: 
 * 
 * Copyright (c) 2024 by Mcc, All Rights Reserved. 
-->
<script lang="ts" setup>
import 'dayjs/locale/zh-cn'

import { App, ConfigProvider } from 'ant-design-vue'
import { storeToRefs } from 'pinia'

import { computed, onMounted } from 'vue'
import { AppProvider } from '@/components/Application'
import { useTitle } from '@/hooks/web/useTitle'
import { useLocale } from '@/locales/useLocale'
import { useAppStore } from '@/store/modules/app'
const { getAntdLocale } = useLocale()
const appStore = useAppStore()
const { themeConfig } = storeToRefs(appStore)
import { usePermissionStore } from '@/store/modules/permission'
const permissionStore = usePermissionStore();
import { useRouter } from 'vue-router';
const router = useRouter();
const componentSize = computed(() => appStore.getComponentSize)
// Listening to page changes and dynamically changing site titles
useTitle()
onMounted(async () => {

  // const routeList = await permissionStore.buildRoutesAction()
  // routeList.forEach((route) => {
  //   try {
  //     router.addRoute(route)
  //   }
  //   catch (e) { }
  // })
})

</script>

<template>
  <ConfigProvider :locale="getAntdLocale" :theme="themeConfig" :component-size="componentSize">
    <App class="h-full w-full">
      <AppProvider>
        <RouterView />
      </AppProvider>
    </App>
  </ConfigProvider>
</template>
<style lang="less">
@font-face {
  font-family: 'pingfang';
  src: url('./assets/font/PingFangSC.otf');
}

body,
#app {
  font-family: 'pingfang';
  overflow: auto;
  overflow-x: hidden;
  background: #f5f7fb;

}
</style>